﻿Imports System.Data.OleDb

Partial Class Default2
    Inherits System.Web.UI.Page
    Protected Sub pbSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles pbSubmit.Click
        Dim oleDBConn As New OleDbConnection(ConfigurationManager.ConnectionStrings("AllAboutForexDBConnectionString").ConnectionString)
        Dim sqlstmt As String = "INSERT INTO Book_Currency([FirstName] , [LastName] , [Address], [City],[Country], [Postcode], [Phone_Landline], [Phone_Mobile] , [Currency_Booked], [Units] , [Collect_At], [Delivered]) VALUES (@FirstName,@LastName, @Address, @City, @Country, @Postcode, @Phone_Landline,@Phone_Mobile,@Currency_Booked,@Units,@Collect_At,@Delivered)"
        Dim cmd As New OleDbCommand(sqlstmt, oleDBConn)
        cmd.Parameters.AddWithValue("@FirstName", txtFirstName.Text)
        cmd.Parameters.AddWithValue("@LastName", txtLastName.Text)
        cmd.Parameters.AddWithValue("@Address", txtAddress.Text)
        cmd.Parameters.AddWithValue("@City", txtCity.Text)
        cmd.Parameters.AddWithValue("@Country", txtCountry.Text)
        cmd.Parameters.AddWithValue("@Postcode", txtPostcode.Text)
        cmd.Parameters.AddWithValue("@Phone_Landline", txtLandline.Text)
        cmd.Parameters.AddWithValue("@Phone_Mobile", txtMobile.Text)
        cmd.Parameters.AddWithValue("@Currency_Booked", ddCurrency.Text)
        cmd.Parameters.AddWithValue("@Units", txtUnits.Text)
        cmd.Parameters.AddWithValue("@Collect_At", rdCollect.SelectedValue)
        cmd.Parameters.AddWithValue("@Delivered", "N")
        oleDBConn.Open()
        cmd.ExecuteNonQuery()
        oleDBConn.Close()
        Response.Redirect(Request.Url.ToString)
    End Sub

    
End Class


